import Vue from "vue"
import axios from "axios"
export default { 
  data () {
    return {    
		  active: true,
		  foodfls:[],
		  index:2,
    }
  },
  mounted(){  	
	    axios.get('http://localhost:8080/static/test.json')
	    .then(response => {
	    	this.foodfls = response.data;
	    	this.$nextTick(function () {
	    	  var index=this.index;
	    	  var foodfls = response.data;
	    	  for (let i = 0, l = foodfls.length; i < l; i++) {
	    	  	console.log(1);
			        if(i=index){
			        	this.active=true;
			        	
			        	console.log(this.active);
			        	console.log(i);
			        	console.log(index);
			        }
			      }
	　　　　　　　　
	　　　　　　});	;   
	    
	    });
	     	     
  },
  methods: {   	
    	foodflhide: function (){ 
			this.$emit('foodflhide')
    	},
//  	flname: function (event){ 
//  		var flname = event.target.innerHTML  		
//  		localStorage["flname"]=flname;   
//  		console.log(localStorage["flname"]);
//			this.$emit('flname');		
//  	},
    	flname: function (foodfl,index){ 
    		this.$nextTick(function () {
	　　　　　　　　this.foodfls.forEach(function (foodfl) {
	　　　　　　　　　　Vue.set(foodfl,'active',false);
	　　　　　　　　});
	　　　　　　　　Vue.set(foodfl,'active',true);
	　　　　　　});	
    	}
  }	
}